<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Auth\AuthController;
use Illuminate\Support\Facades\App;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('auth/login', [AuthController::class,'getLogin']);
Route::post('auth/login', [AuthController::class,'postLogin']);
Route::post('auth/login123', [AuthController::class,'postLogin123']);
Route::get('/{locale}', function ($locale) {
    App::setLocale($locale);
    $_SESSION['location'] = $locale;
    $locale = App::currentLocale();
    return view('auth.login');
});
Route::get('auth/logout', [AuthController::class,'getLogout']);
